package utilidad;


import java.io.IOException;
import java.net.InetAddress;

public class JPing { 
	public static void main(String[] args) { 
		InetAddress ping; 
		String ip = "127.0.0.1"; // Ip de la máquina remota 
		try { 
			ping = InetAddress.getByName(ip);
			if(ping.isReachable(5000)){ 
				System.out.println(ip+" - responde!"); 
			}else { 
				System.out.println(ip+" - no responde!"); 
			}
		} catch (IOException ex) { System.out.println(ex); } 
	} 
} 